package school.test;

import school.entity.Course;
import school.entity.Student;
import school.entity.Teacher;

// 系统测试类，与基础对象类分属不同包
public class TestSystem {
    public static void main(String[] args) {
        // 1. 创建教师对象
        Teacher teacher1 = new Teacher("T001", "张老师", "男");
        Teacher teacher2 = new Teacher("T002", "李老师", "女");

        // 2. 创建课程对象并关联教师
        Course course1 = new Course("C001", "Java编程", "A101", "周一 8:00-10:00");
        Course course2 = new Course("C002", "数据结构", "B202", "周二 14:00-16:00");
        teacher1.setCourse(course1);
        teacher2.setCourse(course2);
        course1.setTeacher(teacher1);
        course2.setTeacher(teacher2);

        // 3. 打印教师信息及授课信息（调用重写的toString()和printWorkSheet()）
        System.out.println("=== 教师信息 ===");
        System.out.println(teacher1);
        System.out.println(teacher2);
        System.out.println("\n=== 教师工作单 ===");
        teacher1.printWorkSheet();
        teacher2.printWorkSheet();

        // 4. 创建学生对象并选课
        Student student1 = new Student("S001", "小明", "男");
        Student student2 = new Student("S002", "小红", "女");

        System.out.println("\n=== 学生初始信息 ===");
        System.out.println(student1);
        System.out.println(student2);

        student1.selectCourse(course1);
        student2.selectCourse(course2);

        // 5. 打印学生选课信息及课表
        System.out.println("\n=== 学生选课信息 ===");
        System.out.println(student1);
        System.out.println(student2);
        System.out.println("\n=== 学生课表 ===");
        student1.printWorkSheet();
        student2.printWorkSheet();

        // 6. 学生退课并打印结果
        student1.dropCourse();
        System.out.println("\n=== 学生退课后续表 ===");
        student1.printWorkSheet();
    }
}